				<aside class="sidebar-wrapper">
					<?php 
						if (!isset($user)){
					?>
						<form action="login.php" method="post" name="formulario" id="formulario">
							<h3>Login</h3>
							<p>
								Email:<br/><input type="text" name="email" id="email" class="required" />
							</p>
							<p>Senha:<br/><input type="password" name="senha" id="senha" class="required"/></p>
							<p><input type="submit" name="submit" id="submit" value="Login"/></p>
						<?php 
							if (isset($_SESSION['error'])){
								echo "<p class='error'>".$_SESSION['error']."</p>";
							}
						?>
						</form>
						<a href="/savua/signup.php"> Você não é cadastrado? Registre-se aqui </a>
					<?php
						}
					?>
					<div class="evaluations">
						<p><h3># Websites Avaliados:
						<span>
						<?php 
							$count = checklistSize();
							echo $count[0];
						?>
						</span>
						</h3>
						</p>						

						<h3>Últimas Avaliações:</h3>
						<ul>
						<?php 
							$checklists = checklists(5);
							$count = 0;

							while($count < count($checklists) ){
								// if ( strpos($checklists[$count]['url'], "www") == 0 ){
									// echo "<li><a target='_blank' href='http://".$checklists[$count]['url']."'>".$checklists[$count]['url']."</a></li>";
								// }
								// else{
									$html = "<li><a target='_blank' href='/labua/resultado.php?cid=".$checklists[$count]['id']."'>".$checklists[$count]['url']."</a>";
									$html .= "<span class='nota'>Nota ".number_format($checklists[$count]['short_checklist_rating'], 2)."</span></li>";
									echo $html;

								// }
								$count++;
							}
						?>
						</ul>
					</div>

					<div class="links">
						<h3> Links úteis </h3>
						<ul>
						<?php
							$con = getdb();
							$query = pg_query($con, "SELECT * FROM links");
							$num_rows = pg_num_rows($query);
							$count = 0;
							while($count < $num_rows){
								$row = pg_fetch_object($query, $count);
								if ( strpos($row->url, "www") == 0 ){
									echo "<li><a target='_blank' href='http://".$row->url."'>".$row->url."</a></li>";

								}
								else{
									echo "<li><a target='_blank' href='".$row->url."'>".$row->url."</a></li>";
								}
								$count++;							
							}
						?>
						</ul>
						<?php if($user->role == 'admin') {
							?>
							<a href="#" id="addlink">Adicionar Link</a>
							<form action="addlink.php" method="post" id='new_link' name="new_link" style="display:none">
								<p>URL:<br/><input type="text" name="url" id="url" /></p>
								<p>Descrição: <input type="text" name="description" id="description"/></p>
								<p><input type="submit" value="Adicionar" /></p>
							</form>
						<?php
						}
						?>
					</div>

				</aside>
